
#include "RobboLito.h"

int Move50 (typePOS* POSITION)
{
  typeMoveList LIST[256];
  typeMoveList* p;
  EvasionMoves (POSITION, LIST, 0xffffffffffffffff);
  p = LIST;
  while (p->move)
    {
      Make (POSITION, p->move);
      if ( !POSITION->wtm ?
	   (wBitboardK & POSITION->DYN->bAtt) : 
	   (bBitboardK & POSITION->DYN->wAtt) )
	{
	  Undo (POSITION, p->move);
	  p++;
	  continue;
	}
      Undo (POSITION, p->move);
      return 0;
    }
  return HEIGHT (POSITION) - VALUE_MATE;
}
